import Vue from "vue"
import VueRouter from "vue-router"

// 引入组件

import login from '../page/login.vue'
import home from '../page/home.vue'
import logon from '../page/logon.vue'
import notFound from '../page/404.vue'
import sub11 from '../page/menu1/sub1.vue'
import sub12 from '../page/menu1/sub2.vue'
import sub13 from '../page/menu1/sub3.vue'
import sub21 from '../page/menu2/sub1.vue'
import sub31 from '../page/menu3/sub1.vue'
import sub41 from '../page/menu4/sub1.vue'
import sub51 from '../page/menu5/sub1.vue'
import sub61 from '../page/menu6/sub1.vue'
import sub71 from '../page/menu7/sub1.vue'
// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

let routes = [
  {
    path: "/",
    redirect: '/login',
    hidden: true
  },
  {
    path: '/login',
    component: login,
    name: '',
    hidden: true
  },
  {
    path: "/logon",
    component: logon,
    name: '',
    hidden: true,
  },
  {
    path: '/404',
    component: notFound,
    name: '',
    hidden: true
  },
  {
    path: '/menu1',
    component: home,
    name: '首页',
    iconCls: 'el-icon-message', //图标样式class
    children: [
      {
        path: 'sub1',
        component: sub11,
        name: '店铺绩效比拼'
      },
      {
        path: 'sub2',
        component: sub12,
        name: '员工绩效比拼'
      },
      {
        path: 'sub3',
        component: sub13,
        name: '产品销量排名'
      },
    ]
  },
  {
    path: '/menu2',
    component: home,
    name: '订单',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub21,
        name: '未处理订单'
      }
    ]
  },
  {
    path: '/menu3',
    component: home,
    name: '绩效',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub31,
        name: '绩效展示'
      }
    ]
  },
  {
    path: '/menu4',
    component: home,
    name: '采购',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub41,
        name: '采购管理'
      }
    ]
  },
  {
    path: '/menu5',
    component: home,
    name: '店铺',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub51,
        name: '店铺管理'
      }
    ]
  },
  {
    path: '/menu6',
    component: home,
    name: '员工',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub61,
        name: '员工展示'
      }
    ]
  },
  {
    path: '/menu7',
    component: home,
    name: '侵权',
    iconCls: 'el-icon-message',
    children: [
      {
        path: 'sub1',
        component: sub71,
        name: '侵权管理'
      }
    ]
  },
];
var router = new VueRouter({
    routes
})
export default router;